<html>

<head>
<meta charset="UTF-8">
<title>发布通知</title>
</head>
<body>
	<script src="/js/announce.js"></script>
	<link rel="stylesheet" type="text/css" href="/css/form.css" />
	<script type="text/javascript">
		$(".navigation span:first").text("通知管理");
	</script>
	<#include "/head.ftl"/>
	<div class="content">
		<div class="tab">
			<div class="tab-header">
				<a title="返回" class="btn btn-setting" onclick="back(this)">
					<i class="iconfont icon-undo"></i>
				</a> <a title="刷新" class="btn btn-setting" onclick="refresh(this)">
					<i class="iconfont icon-refresh"></i>
				</a> 
			</div>
			<div class="form-content">
				<form id="announceForm" method="post">
					<fieldset>
						<table>
							<tr>
								<td>通知类型：</td>
								<td>
									<select name="type" onchange="isAnnounce()">
										<option value="">-请选择类型-</option>
										<#list types['announce'] as ta>
											<#if announce?? && ta.value==announce.type>
												<option value="${ta.value}" selected="selected">${ta.name}</option>
											<#else>
												<option value="${ta.value}">${ta.name}</option>
											</#if>
										</#list>
									</select>
								</td>
								<td>通知状态：</td>
								<td>
									<select name="status">
										<#list status['announce'] as sa>
											<#if announce?? && sa.value==announce.status>
												<option value="${sa.value}" selected="selected">${sa.name}</option>
											<#else>
												<option value="${sa.value}">${sa.name}</option>
											</#if>
										</#list>
									</select>
								</td>
							</tr>
							<tr>
								<td>通知标题：</td>
								<td colspan="3"><input type="text" name="title" placeholder="标题不超过20个字符" maxlength="20" value="${(announce.title)?default('')}"></td>
							</tr>
							<tr>
								<td>通知用户：</td>
								<td colspan="3">
									<#if announce??>
										<#list announce.announceUsers as auser>
											<input class="userId" type="hidden" name="auser[${auser_index}].user" value="${auser.user.id}">
										</#list>
									</#if>
									
									<input name="users" id="tagUser" type="text" >
								</td>
							</tr>
							<tr>
							</tr>
							<tr>
								<td>通知内容：</td>
								<td colspan="3"><textarea name="content" rows="5" cols="50"><#if announce??>${announce.content}</#if></textarea></td>
							</tr>
							<tr>
								<td style="text-align: center;" colspan="4">
									<input type="hidden" name="user" value="${userinfo.id}">
									<input type="hidden" name="id" value="${(announce.id)?default('')}">
									<button class="button" style="padding: 11px 40px;">保存</button>
								</td>
							</tr>
						</table>
					</fieldset>
				</form>
			</div>
		</div>

	</div>
</body>
</html>